<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:winter="http://www.winter.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="/layouts/layout">
	
	<div id="DireccionGestionFragment" th:fragment="DireccionGestionFragment">
		<winter:output id="mainDireccionDialogOutput" class="winter-form form-container">
			<winter:output id="formDireccionDialogOutput" class="cabecera">
				<winter:row>
					<winter:column type="col-md-4">
						<winter:select id="selectTipoDomicilio" 
							field="*{domicilio.tipo}"
							collection="tiposDom, rowTiposDom : ${personas.tipos}"
							value="${tiposDom.id}" 
							text="@{${tiposDom.descripcion}}"
							label="@{'Tipo: '}" 
							required="true"
							requiredmessage="Favor seleccione un tipo de domicilio"
							modern="true"
							showglobalmessage="true">
						</winter:select>
					</winter:column>
					<winter:column type="col-md-4">
						<winter:textarea id="NuevoPersonaCallePrincipal"
							field="*{domicilio.callePrincipal}"
							label="#{label.common.calle.principal}" 
							required="true"
							requiredimage="/images/icons/exclamation-small-red.png"
							requiredmessage="#{label.common.calle.principal.requerido}"
							maxlength="250"
							maxlengthmessage="Favor ingrese hasta 250 digitos"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded">
						</winter:textarea>
					</winter:column>
					<winter:column type="col-md-4">
						<winter:textarea id="NuevoPersonaCalleAlt"
							field="*{domicilio.calleAlternativa}"
							label="#{label.common.calle.alternativa}" 
							required="false"
							requiredimage="/images/icons/exclamation-small-red.png"
							requiredmessage="#{label.common.calle.alternativa.requerido}"
							maxlength="250"
							maxlengthmessage="Favor ingrese hasta 250 digitos"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded">
						</winter:textarea>
					</winter:column>
				</winter:row>
				<winter:row>
					<winter:column type="col-md-4">
						<winter:inputtext id="NuevoPersonaNumeroDom"
							field="*{domicilio.numero}"
							label="#{label.common.numero}" 
							required="false"
							requiredimage="/images/icons/exclamation-small-red.png"
							requiredmessage="#{label.common.numero.requerido}"
							maxlength="10"
							maxlengthmessage="Favor ingrese hasta 10 digitos"
							type="float"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize">
						</winter:inputtext>
					</winter:column>
					<winter:column type="col-md-4">
						<winter:inputtext id="NuevoPersonaPisoDom"
							field="*{domicilio.piso}" 
							label="#{label.common.piso}" 
							required="false"
							requiredimage="/images/icons/exclamation-small-red.png"
							requiredmessage="#{label.common.piso.requerido}"
							maxlength="5"
							maxlengthmessage="Favor ingrese hasta 5 digitos"
							type="float"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize">
						</winter:inputtext>
					</winter:column>
					<winter:column type="col-md-4">
						<winter:inputtext id="NuevoPersonaUnidadDom"
							field="*{domicilio.unidad}"
							label="#{label.common.unidad}" 
							required="false"
							requiredimage="/images/icons/exclamation-small-red.png"
							requiredmessage="#{label.common.unidad.requerido}"
							maxlength="5"
							maxlengthmessage="Favor ingrese hasta 5 digitos"
							type="float"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize">
						</winter:inputtext>
					</winter:column>
				</winter:row>
				<winter:row>
					<winter:column type="col-md-4">
						<winter:select id="selectDepartamento"
							field="*{domicilio.departamento}"
							collection="dtos, rowDtos : ${personas.departamentos}"
							value="${dtos.id}" 
							text="@{${dtos.nombre}}"
							label="@{'Departamento: '}" 
							required="true"
							requiredmessage="Favor seleccione un departamento" 
							modern="true"
							showglobalmessgae="true">
						</winter:select>
						<winter:event id="EventDepartamentos" event="change"
							target="selectDepartamento"
							url="@{'/personas/departamentoEvent'}" form="PersonasForm"
							update="distritoOutput" object="personas" immediate="true"
							showstatus="true" showstatuselement="true">
						</winter:event>
					</winter:column>
					<winter:column type="col-md-4">
						<winter:output id="distritoOutput">
							<winter:select id="selectDistrito" 
								field="*{domicilio.distrito}"
								collection="distr, rowDistr : ${personas.distritos}"
								value="${distr.id}" 
								text="@{${distr.nombre}}"
								label="@{'Distrito: '}" 
								modern="true"
								showglobalemessage="true">
							</winter:select>
						</winter:output>
					</winter:column>
				</winter:row>
				<winter:row class="button-panel-right" padded="true">
					<winter:ajaxSubmit id="CrearDomicilio" 
						form="PersonasForm"
						url="@{'/personas/guardarDomicilio'}"
						update="DireccionesInclude"
						object="personas" 
						value="#{label.operaciones.guardar}" 
						showstatus="true"
						class="btn btn-cyan"
						process="DomiciliaCrearContainer"
						oncomplete="@{'Winter.ui.CloseDialog(\'DomicilioDialog\')'}">
					</winter:ajaxSubmit>
					<winter:ajaxSubmit id="CrearDomicilioCancelar"
						form="PersonasForm" object="personas"
						url="@{'/personas/cancelar/DOMICILIO'}"
						update="DialogOutput, CrearEditarPersonaOutput"
						value="#{label.operaciones.cancelar}" showstatus="true"
						class="btn btn-danger" process="DomiciliaCrearContainer"
						immediate="true"
						oncomplete="@{'Winter.ui.CloseDialog(\'DomicilioDialog\')'}">
					</winter:ajaxSubmit>
				</winter:row>
		    </winter:output>
		</winter:output>
	</div>
</html>